﻿@using Signum.Entities.DynamicQuery
@using Signum.Entities.Reflection
@using Signum.Engine.DynamicQuery
@using Signum.Web.Properties
@model Context
@{ 
    List<FilterOption> filterOptions = (List<FilterOption>)ViewData[ViewDataKeys.FilterOptions];
    QueryDescription queryDescription = (QueryDescription)ViewData[ViewDataKeys.QueryDescription];
}

<div class="ui-widget-content ui-corner-bottom sf-filters-list">
    <span class="sf-explanation" style="@((filterOptions == null || filterOptions.Count == 0) ? "" : "display:none;")">@Resources.NoFiltersSpecified</span>
    <table id="@Model.Compose("tblFilters")" style="@((filterOptions == null || filterOptions.Count == 0) ? "display:none;" : "")">
        <thead>
            <tr>
                <th>
                </th>
                <th class="sf-filter-field-header">@Resources.Field
                </th>
                <th>@Resources.Operation
                </th>
                <th>@Resources.Value
                </th>
            </tr>
        </thead>
        <tbody>
            @for (int i = 0; i < filterOptions.Count; i++)
            {
                FilterOption filter = filterOptions[i];
                @Html.NewFilter(queryDescription.QueryName, filter, Model, i)
            }
        </tbody>
    </table>
</div>
